package hoang.hut.app.utility.notification;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

public class NotificationUtility {

	@SuppressWarnings("deprecation")
	public static void showNotification(Context mContext, int icon, String message,
			String title, String content, int notificationId) {

		Notification notification;
		NotificationManager notificationManager;
		
		//Context context = activity.getApplication();
		notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
		notification = new Notification(icon, message,System.currentTimeMillis());

		Intent intent = new Intent(Intent.ACTION_VIEW,	Uri.parse("http://google.com.vn"));
		PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0,
				intent, 0);
		notification.setLatestEventInfo(mContext, title, content, contentIntent);

		// add am thanh notification.defaults |= Notification.DEFAULT_SOUND;
		notification.defaults |= Notification.DEFAULT_SOUND;
		
		notification.flags |=Notification.FLAG_AUTO_CANCEL;

		// set rung cho notification notification.defaults |=
		notification.defaults |= Notification.DEFAULT_VIBRATE;

		notificationManager.notify(notificationId, notification);
	}
}
